2 * Adium is the legal property of its developers, whose names are listed in the copyright file included
3 * with this source distribution.
5 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
6 * General Public License as published by the Free Software Foundation; either version 2 of the License,
7 * or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
10 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11 * Public License for more details.
13 * You should have received a copy of the GNU General Public License along with this program; if not,
14 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 #import <Adium/AIPlugin.h>
18 #import <WebKit/WebKit.h>
19 #import <Adium/AIInterfaceControllerProtocol.h>
22 * @brief Preference group for webkit display prefs
23 * @see AIPreferencesController
25 #define PREF_GROUP_WEBKIT_MESSAGE_DISPLAY @"WebKit Message Display"
28 * @brief Preference group for custom images as background in the webkit message view
29 * @see AIPreferencesController
31 #define PREF_GROUP_WEBKIT_BACKGROUND_IMAGES @"WebKit Custom Backgrounds"
34 * @brief Preference group for default settings
35 * @see AIPreferencesController
37 #define WEBKIT_DEFAULT_PREFS @"WebKit Defaults"
40 * @brief The bundle identifier of the style we revert to if the preferred style isn't available
42 #define WEBKIT_DEFAULT_STYLE @"com.adiumx.stockholm.style"
45 * @brief The path to the currently selected message style
47 #define KEY_CURRENT_WEBKIT_STYLE_PATH @"Current Style Path"
50 * @brief Key for the preference controlling whether we should show user icons in the message view
52 #define KEY_WEBKIT_SHOW_USER_ICONS @"Show User Icons"
55 * @brief Key for the preference controlling whether we should show a header in the message view
57 #define KEY_WEBKIT_SHOW_HEADER @"Show Header"
60 * @brief Key for the preference controlling whether we should show received message colors
62 #define KEY_WEBKIT_SHOW_MESSAGE_COLORS @"Show Message Colors"
65 * @brief Key for the preference controlling whether we should show received message fonts
67 #define KEY_WEBKIT_SHOW_MESSAGE_FONTS @"Show Message Fonts"
70 * @brief Key for the preference controlling how the usernames should be displayed
72 #define KEY_WEBKIT_NAME_FORMAT @"Name Format"
75 * @brief Key for the preference controlling whether we're using a custom format for usernames
77 #define KEY_WEBKIT_USE_NAME_FORMAT @"Use Custom Name Format"
80 * @brief Key for the preference controlling what message style is in use
82 #define KEY_WEBKIT_STYLE @"Message Style"
85 * @brief Key for the preference controlling how the timestamp on messages should be formatted
87 #define KEY_WEBKIT_TIME_STAMP_FORMAT @"Time Stamp"
90 * @brief Key for the preference controlling the minimum font size in the message view
92 #define KEY_WEBKIT_MIN_FONT_SIZE @"Min Font Size"
94 #define NEW_CONTENT_RETRY_DELAY 0.01
96 @
class ESWebKitMessageViewPreferences
, AIChat
, AIWebkitMessageViewStyle
;
99 * @class AIWebKitMessageViewPlugin AIWebKitMessageViewPlugin.h
100 * @brief Handles loading the WKMV plugin into Adium
101 * @see AIWebKitMessageViewController
103 @interface AIWebKitMessageViewPlugin
: AIPlugin
<AIMessageDisplayPlugin
> {
104 ESWebKitMessageViewPreferences
*preferences
;
105 NSMutableDictionary
*styleDictionary
;
106 AIWebkitMessageViewStyle
*currentStyle
;
110 * @return a new webkit message view controller initialized to display inChat
111 * @param inChat the chat that the message view will display
113 - (id
<AIMessageDisplayController
>)messageDisplayControllerForChat
:(AIChat
*)inChat
;
116 * This method is fairly expensive the first time it's run; however, the first time will almost always been in a thread at startup, to preload the styles. This method is threadsafe.
117 * @return A dictionary of all available message styles, with their identifiers as keys
119 - (NSDictionary
*)availableMessageStyles
;
122 * @return a message style NSBundle
123 * @param identifier the identifier of the message style
125 - (NSBundle
*)messageStyleBundleWithIdentifier
:(NSString
*)identifier
;
128 * @brief Returns a preference key which is style specific
129 * @param key The preference key
130 * @param style The style name it will be specific to
132 - (NSString
*)styleSpecificKey
:(NSString
*)key forStyle
:(NSString
*)style
;
135 * @brief Returns the shared instance of the currently used message style
137 - (AIWebkitMessageViewStyle
*) currentMessageStyle
;